home *** CD-ROM | disk | FTP | other *** search
/ 8bitfiles.net/archives / archives.tar / archives / compuserve-file-archive / 05 Programming / ASTERI.SFX / pam+dir.doc < prev    next >
Text File  |  1990-02-12  |  1KB  |  49 lines

  1.        DIR and PAM table formats                                      18/2/1991
  2.                                                                           Polar
  3. PAM (Page allocation map) -- Determines the status of memory pages wrt to the
  4.    Ramdrive (256 bytes, $2000-$20FF) The offset from $2000 is the pagenumber
  5.    The value is the status of the page.
  6.        0:  Unavaible
  7.        1:  Availble & unused
  8.        2:  Last-page-of-a-file
  9. anything else: Link to the next page in a file
  10.  
  11. eg: Check if $8000-$87FF is used by the ramdrive before using UDGs in that area
  12.  
  13. chkUDG ldx #$80
  14. loop1  lda PAM,x
  15.        cmp #2
  16.        bcs used
  17.        inx
  18.        cpx #$88
  19.        bne loop1
  20.        jmp loadUDGs
  21. used   jmp forgetit
  22.  
  23.  
  24.  
  25.  
  26. DIR FORMAT
  27.    The DIR (Directory table) contains 96 records of 32 bytes length each.
  28.  
  29. Offset within  Purpose
  30. record
  31.        0       Parent DIR fnum
  32.        1       Starting page of file
  33.      2,3       Length of file (lo,hi)
  34.        4       Protection byte (see below)
  35.     5-20       Name (16 chars, padded with spaces, left justified)
  36.    22,23       File pointer to current char when file opened
  37.       24       Open-file-mode
  38.  
  39.  
  40. PROTECTION BYTE FORMAT - Byte 4 of DIR record
  41.  
  42. Bit  7  6  5  4  3  2  1  0
  43.      ¡@@▒@@╜  ~  ¡« ~  ~  ~
  44.      Unused  ░Read] ]  ¡@@▒@▓ 00 = Del/unused
  45.              ]   ░╜ ]  Entry½ 01 = Directory
  46.              ½Write ]  type ½ 10 = Undefined
  47.   User access│      ]       ¡ 11 = File
  48.              ¡Exicute
  49.